Checking past and future climates at the location of the populations
Published
April 30, 2024
1 Introduction
Goal: compare the values of the climatic variables at the location of the populations under current and future climates. The climatic data can be generated in two ways:
point estimates at the location of the population, generated using scale-free downscaling, resulting in higher precision.
extracted values from rasters. The pixel values in the raster file correspond to the mean values of the climatic variables across the period considered.
Comment: in all the plots below, the points corresponds to the 34 studied populations of maritime pine and the colors correspond to the main gene pool they belong to.
Precipitation seasonality (coefficient of variation)
index
SHM
Summer heat moisture index
°C / mm
2 Comparing past reference periods
To account for the climates under which the populations have evolved, we could use the reference period 1901-1950 or 1961-1990.
Until now, we have used the reference period 1901-1950 to capture as much as possible the climate under which the populations have evolved, i.e. before the human-induced climate change. Note that the human induced climate change may be minor before 1990 so we may use the pre-industrialization period 1961-1990 period, which may not be very different from the 1901-1950 period.
Another reason we used the reference period 1901-1950 is that our reference period has to be before 1983 because we have to use the gene-climate relationships estimated under this reference period to then predict the disruption of the gene-environment relationships under the climates between 1983 and 2014 at the location of the National Forest Inventory plots (one of the validation steps of the genomic offset method we do in the paper).
Note that the historic climatic layers for the 1901-1950 period may not be very accurate according to Maurizio Marchi, that’s why he suggested to use the 1961-1990 period.
Below, we compare the mean values of the climatic variables of interest for the reference period 1901-1950 and 1961-1990. We use point estimates climatic data adjusted or not for elevation.
Code
# Load population past climate (point estimates) in a list with data adjusted or not for elevation# The rds file corresponds to a list with different reference periods, here 1901-1950 and 1961-1990list_clim_past <-list(ADJ=list(name="adjusted for elevation",code="ADJ",data=readRDS(here("data/ClimaticData/MaritimePinePops/ClimatePopulationLocationPointEstimates_ReferencePeriods_ADJ.rds"))),noADJ=list(name="NOT adjusted for elevation",code="noADJ",data=readRDS(here("data/ClimaticData/MaritimePinePops/ClimatePopulationLocationPointEstimates_ReferencePeriods_noADJ.rds"))))# Load information about the main gene pool of each population (for the figures)gps <-readRDS(here("data/GenomicData/MainGenePoolPopulations.rds")) %>%arrange(pop)# Population coordinates as spatial points (for the extraction of future climates)pop_coord <- list_clim_past[[1]]$data$ref_1901_1950$ref_means %>% dplyr::select(longitude,latitude) %>%SpatialPoints(proj4string=CRS("+proj=longlat +datum=WGS84 +no_defs"))
Similar values between adjusted or not adjusted climatic data.
The mean climatic values across the reference periods 1901-1950 and 1961-1990 are mostly similar for AHM and SHM.
Increase in mean annual temperature (bio1) for all populations across the 1961-1990 period compared to the 1901-1950 period.
Populations from the French Atlantic gene pool experienced a decrease in isothermality and Hargreaves reference evaporation and an increase in mean temperature of the driest quarter.
Populations from the Iberian gene pool experienced an increase in isothermality, mean annual temperature and Hargreaves reference evapotranspiration.
3 Point estimates vs raster extraction
Code
# Function to extract the climatic variables from rasters# =======================================================extract_clim_var <-function(x,gcm,period,ssp){if(period=="1901-1950"){ path <-paste0("data/ClimaticData/ClimateDTRasters/1km_1901-1950_Extent-JulietteA/",x,".tif")} else { path <-paste0("data/ClimaticData/ClimateDTRasters/1km_",gcm,"_",period,"_",ssp,"_Extent-JulietteA/",x,".tif") }# For the variable Eref, there are some NAs for some populations# So we start with a simple extraction (extraction of the cell value if the point falls within the cell)# and if there are some NAs, we perform a bilinear extraction# bilinear interpolation = the returned values are interpolated from the values of the four nearest raster cells.# And we replace the NAs by the extracted values obtained with the bilinear method# if there are still NAs, we extract cell values using a buffer of 2km# If the distance between the sampling point and the center of a cell is less than or equal to the buffer, the cell is included. # We take the mean (fun=mean) of the cell values obtained with the extraction done with the buffer method# And we replace the NAs by the values obtained with the buffer method (with a buffer of 2km)# If there are still NAs, we do the same with a buffer of 3kmext_simple <- raster::raster(here(path)) %>% raster::extract(pop_coord)i <-is.na(ext_simple)if(length(which(i==TRUE)) !=0){ext_bilinear <- raster::raster(here(path)) %>% raster::extract(pop_coord,method="bilinear")ext_simple[i] <- ext_bilinear[i]i <-is.na(ext_simple)if(length(which(i==TRUE)) !=0){ext_buff <- raster::raster(here(path)) %>% raster::extract(pop_coord,buffer=2000,fun=mean)ext_simple[i] <- ext_buff[i]i <-is.na(ext_simple)if(length(which(i==TRUE)) !=0){ext_buff <- raster::raster(here(path)) %>% raster::extract(pop_coord,buffer=3000,fun=mean)ext_simple[i] <- ext_buff[i]i <-is.na(ext_simple)}}}return(ext_simple)}
3.1 Past climate (1901-1950)
We compare the point estimates climatic values (from csv) with extracted values from raster files for the period 1901-1950.
Conclusion: Point estimate values and climatic values extracted from rasters are very similar, thus suggesting that we can use them interchangeably. Point estimate values adjusted or not for elevation are also similar, so using one or the other should not influence the results of the following analyses.
4 Comparing past and future climates
We compare the past and future climates using either:
the raw difference between the mean future climate and mean past climate (i.e. mean future climate - mean past climate)
the relative climatic distance: relative distance = ( future climatic value - past climatic value ) / past climatic value.
4.1 Raw differences between past and future climates
We calculate the raw difference between the mean future climate and mean past climate (i.e. mean future climate - mean past climate) using:
climatic values extracted from rasters for the future climates of the five global climate models (GCMs) for the period 2041-2070 and SSP3-7.0.
past climatic values either from point estimates or extracted from rasters (reference period 1901-1950).
Code
# Point estimate future climatic values (2041-2070 - GFDL-ESM4 - SSP 3.7-0)fut_clim <-readRDS(here("data/ClimaticData/MaritimePinePops/ClimatePopulationLocationsPointEstimates_GFDL-ESM4_SSP370_2041-2070.rds"))# GCM namesgcm_names <-list.files(here("data/ClimaticData/ClimateDTRasters/")) %>%str_sub(5,-35) %>%setdiff("")# Extract population future climate for each GCM and merge with past climatic datafut_rast <-lapply(list_clim_past, function(clim_past){lapply(clim_past$data, function(y){df_ref_means <- y$ref_means %>% dplyr::select(pop,all_of(clim_var)) %>%pivot_longer(cols=clim_var,names_to="variable",values_to="mean_ref")lapply(clim_var, function(x){lapply(gcm_names, function(gcm) extract_clim_var(x=x,gcm=gcm,period="2041-2070",ssp="ssp370")) %>%setNames(gcm_names) %>%as_tibble() %>%mutate(pop=unique(clim_past$data[[1]]$ref_means$pop))}) %>%setNames(clim_var) %>%bind_rows(.id ="variable") %>%pivot_longer(names_to ="gcm",values_to="mean_fut",cols=all_of(gcm_names)) %>%mutate(fut_method="extracted from rasters") %>%mutate(ref_period=paste0(y$range[[1]],"-",y$range[[2]])) %>%left_join(df_ref_means, by=c("pop","variable")) %>%left_join(gps, by="pop") }) %>%bind_rows() %>%mutate(adj=clim_past$code)}) %>%bind_rows()
Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
ℹ Please use `all_of()` or `any_of()` instead.
# Was:
data %>% select(clim_var)
# Now:
data %>% select(all_of(clim_var))
See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
To compare past and future climatic values, we calculate, for each GCM and each climatic variable, the relative distance between past and future climatic values, i.e relative distance = ( future climatic value - past climatic value ) / past climatic value.
4.2.1 Future climatic data from rasters
On the graph below, the relative distances are on the y-axis and are calculated using point estimates for the past climates (i.e. climates under the reference periods 1901-1950 or 1961-1990) and raster data for the future climates (mean predicted climatic values across the period 2041-2070 and the SSP3-7.0. The past climates correspond to:
either the reference period 1901-1950 or 1961-1990.
either the adjusted or not adjusted data for elevation.
Code
violin_plots <-lapply(unique(fut_rast$adj), function(y){lapply(unique(fut_rast$ref_period), function(z){violin_plots <-lapply(gcm_names, function(x) {fut_rast %>% dplyr::filter(gcm %in% x) %>% dplyr::filter(ref_period %in% z) %>% dplyr::filter(adj %in% y) %>%mutate(rel_diff=(mean_fut-mean_ref)/mean_ref) %>%mutate(main_gp_pop=factor(main_gp_pop,levels=c("Northern Africa","Corsica","Central Spain","French Atlantic","Iberian Atlantic","South-eastern Spain"))) %>%ggplot(aes(x=variable, y=rel_diff)) +geom_hline(yintercept=0, color=bg_color) +geom_violin(alpha=0.2, fill="gray76", color=bg_color) +geom_jitter(shape=16,aes(colour=main_gp_pop),position=position_jitter(0.2),size=1.7) +scale_colour_manual(values =c("orangered3","gold2","darkorchid3","navyblue","turquoise2","green3")) +xlab("") +ylab("Relative climatic distance") +labs(colour="Main gene pool") +theme_bw() +ggtitle(x) +theme(legend.position="none",legend.title =element_text(size=14, color=bg_color),legend.text =element_text(size =14, color=bg_color),axis.text =element_text(size =14, color=bg_color),axis.title =element_text(size=16, color=bg_color)) +guides(colour =guide_legend(override.aes =list(size=4))) })# legend violin_plots$legend <-get_legend(violin_plots[[1]] +theme(legend.position =c(0.5,0.5)) )# make titletitle <-ggdraw() +draw_label(paste0("Future climate from rasters vs reference period ",z," (point estimates ",list_clim_past[[y]]$name,")"),fontface ='bold',x =0,hjust =0) +theme(plot.margin =margin(0, 0, 0, 7))# merge plotsp <-plot_grid(plotlist=violin_plots)# ========================================# Figure for the Supplementary Information# We save plots for the reference period 1901-1950 and with point estimates not adjusted for elevationif (y=="noADJ"& z=="1901-1950"){ggsave(p,device="pdf",filename=here("figs/ExploratoryAnalyses/RelativeClimaticDistances_SelectedVariables.pdf"),width=12,height=10)}# ========================================# merge plots + titleplot_grid(title, p, ncol =1,rel_heights =c(0.1, 1))})})
Warning in get_plot_component(plot, "guide-box"): Multiple components found; returning the first one. To return all, use `return_all = TRUE`.
Warning in get_plot_component(plot, "guide-box"): Multiple components found; returning the first one. To return all, use `return_all = TRUE`.
Warning in get_plot_component(plot, "guide-box"): Multiple components found; returning the first one. To return all, use `return_all = TRUE`.
Warning in get_plot_component(plot, "guide-box"): Multiple components found; returning the first one. To return all, use `return_all = TRUE`.
Code
violin_plots
We also create a figure for the Supplementary Information in which we highlight in pink the populations ALT and ARM, i.e. the two populations considered the most at risk of maladaptation with GDM and GF based on the candidate SNPs (the two methods for which GO predictions were the best predictors of mortality rates in the NFI populations and the common gardens).
Code
y="noADJ"# point estimates not adjusted for elevationz="1901-1950"# we use the reference period 1901-1950 violin_plots <-lapply(gcm_names, function(x) {df <- fut_rast %>% dplyr::filter(gcm %in% x) %>% dplyr::filter(ref_period %in% z) %>% dplyr::filter(adj %in% y) %>%mutate(rel_diff=(mean_fut-mean_ref)/mean_ref) %>%mutate(pop_to_color=ifelse(pop %in%c("ALT","ARM"), pop, "Other populations"))ggplot(df,aes(x=variable, y=rel_diff)) +geom_hline(yintercept=0, color=bg_color) +geom_violin(alpha=0.2, fill="gray76", color=bg_color) +geom_jitter(data=df %>% dplyr::filter(pop_to_color %in%"Other populations"),shape=16,colour="lightskyblue1",position=position_jitter(0.2),size=1.7) +geom_jitter(data=df %>% dplyr::filter(pop_to_color %in%c("ALT","ARM")),shape=16,colour="deeppink",position=position_jitter(0.2),size=2) +xlab("") +ylab("Relative climatic distance") +labs(colour="Main gene pool") +theme_bw() +ggtitle(x) +theme(legend.position="none",legend.title =element_text(size=14, color=bg_color),legend.text =element_text(size =14, color=bg_color),axis.text =element_text(size =14, color=bg_color),axis.title =element_text(size=16, color=bg_color)) +guides(colour =guide_legend(override.aes =list(size=4))) })# merge plotsp <-plot_grid(plotlist=violin_plots)# We save the plot for the Supplementary Information:ggsave(p,device="pdf",filename=here("figs/ExploratoryAnalyses/RelativeClimaticDistances_SelectedVariables_2PopsHighlighted.pdf"),width=12,height=10)p
Interpretation: For all populations, AHM, SHM, bio1 and bio9 and Eref are predicted to increase under future climates. Some exceptions for AHM for some populations from the Iberian and French Atlantic regions for the MRI-ESM2-0 GCM. Different predictions across GCMs for the OLB populations. The different predictions across GCMs show the importance of calculating the genomic offset under the different GCMs.
4.2.2 Future climatic data from point estimates
In the graphs below, the future and past climates correspond to point estimates adjusted or not for elevation.
Marchi, Maurizio, Gabriele Bucci, Paolo Iovieno, and Duncan Ray. 2024. “ClimateDT: A Global Scale-Free Dynamic Downscaling Portal for Historic and Future Climate Data.”Environments 11 (4): 82.